package com.hexinfo.dmpro.admin.model;

import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;

/**
 * @ClassName Menu
 * @Describe
 * @Author ml.wang
 * @Date 2021-06-16
 */
@Data
public class Menu implements Serializable {

    private Long id;

    /** 是否为外链 true/false */
    private Boolean iFrame;

    private String name;

    private String component;

    /** 上级菜单ID */
    private Long pid;

    private Long sort = 999L;

    private String icon;

    private String path;

    private Boolean cache;

    private Boolean hidden;

    private String componentName;

    private Timestamp createTime;

    /** 权限 */
    private String permission;

    /** 类型，目录、菜单、按钮 */
    private Integer type;

    private List<Menu> children;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Menu menu = (Menu) o;
        return Objects.equals(id, menu.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }

}
